|
|
|
|
|
|
|
You'll also be shown another way of accessing the Common Dialog features through the use of the Dialog Automation object available on Visual Basic's CD-ROM. You can include this object in your applications instead of the Common Dialog control. |
|
|
|
|
|
|
|
|
What the Common Dialog Is All About |
|
|
|
|
|
|
|
|
When the old DOS-based computers changed from black-and-white to color displays, many new commands had to be created for users to change these new properties. Then, when Windows was introduced, developers knew that users would perform many activities over and over. The outcome of this knowledge led to the creation of a set of Windows dialog boxes that interfaced with users. As more and more programs were written for Windows, many programmers copied the dialog boxes in this set. It was around this time that developers started calling them common dialogs. |
|
|
|
|
|
|
|
|
When Microsoft started producing developer tools such as Visual Basic for the Windows environment, the company created a special toolthe Common Dialog control. This control, included with every version of Visual Basic, can be used by any programming language that can access an.OCX file. The Common Dialog control provides a standard set of dialog boxes for functions such as opening and saving files, setting print options, and changing colors and fonts. The control can also display help through the Windows help engine. |
|
|
|
|
|
|
|
|
At this point, you may be thinking that the Common Dialog control is no big dealthat if you wanted to, you could write your own interfaces for these functions. Through the years, this is exactly what many programmers did, and you could see the differences between different products. No one product looked like another, and for users this made learning how to use various products difficult. To get an idea of why this control is now used by developers, investigate what is would take to create just the open dialog. The following controls would be needed to create one version of an open dialog form: |
|
|
|
|
|
|
|
|
Two simple drop-down controls |
|
|
|
|
|
|
|
|
Toolbar with four buttons on it |
|
|
|
|
|
|
|
|
Two Command Button controls |
|
|
|
|
|
|
|
|
You also would have to access several system API functions to get some of the information you want to display. |
|
|
|
|
|